package View.FornecedorView;

import java.awt.Dimension;

import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.LayoutStyle.ComponentPlacement;

import Controller.FornecedorController.FornecedorController;
import Entidade.Fornecedor;
import framework.component.field.TTextField;
import framework.mvc.GenericView;

public class FornecedorView extends GenericView<Fornecedor> {

	private static final long serialVersionUID = 2638493735437594953L;
	private TTextField textField;
	private TTextField textField_1;
	private TTextField textField_2;
	private TTextField textField_3;
	private TTextField textField_5;
	private TTextField textField_6;

	public FornecedorView() {
		super(new FornecedorController());
		setTitle("Fox Empresarial - Cadastro de Fornecedores");
		setSize(new Dimension(450, 266));

		JLabel label = new JLabel("Nome:");

		JLabel label_1 = new JLabel("CPF/CNPJ:");

		JLabel label_2 = new JLabel("Email:");

		JLabel label_3 = new JLabel("Telefone:");

		JLabel label_4 = new JLabel("Fantasia:");

		JLabel label_5 = new JLabel("Complemento:");

		textField = new TTextField();
		textField.setName("FantasiaFornecedor");
		textField.setColumns(10);

		textField_1 = new TTextField();
		textField_1.setName("TelefoneFornecedor");
		textField_1.setColumns(10);

		textField_2 = new TTextField();
		textField_2.setName("EmailFornecedor");
		textField_2.setColumns(10);

		textField_3 = new TTextField();
		textField_3.setName("CPF_CNPJFornecedor");
		textField_3.setColumns(10);

		textField_5 = new TTextField();
		textField_5.setName("NomeFornecedor");
		textField_5.setColumns(10);

		textField_6 = new TTextField();
		textField_6.setName("ComplementoFornecedor");
		textField_6.setColumns(10);

		JButton btnCancelar = new JButton("Cancelar");
		btnCancelar.setName("cancelar");

		JButton btnSalvar = new JButton("Salvar");
		btnSalvar.setName("salvar");
		GroupLayout groupLayout = new GroupLayout(getContentPane());
		groupLayout
				.setHorizontalGroup(groupLayout
						.createParallelGroup(Alignment.LEADING)
						.addGroup(
								groupLayout
										.createSequentialGroup()
										.addContainerGap()
										.addGroup(
												groupLayout
														.createParallelGroup(
																Alignment.LEADING)
														.addComponent(
																label,
																GroupLayout.PREFERRED_SIZE,
																31,
																GroupLayout.PREFERRED_SIZE)
														.addGroup(
																groupLayout
																		.createSequentialGroup()
																		.addGroup(
																				groupLayout
																						.createParallelGroup(
																								Alignment.LEADING)
																						.addComponent(
																								label_1,
																								GroupLayout.PREFERRED_SIZE,
																								52,
																								GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								label_2,
																								GroupLayout.PREFERRED_SIZE,
																								28,
																								GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								label_3)
																						.addComponent(
																								label_4,
																								GroupLayout.PREFERRED_SIZE,
																								45,
																								GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								label_5,
																								GroupLayout.PREFERRED_SIZE,
																								69,
																								GroupLayout.PREFERRED_SIZE))
																		.addPreferredGap(
																				ComponentPlacement.UNRELATED)
																		.addGroup(
																				groupLayout
																						.createParallelGroup(
																								Alignment.LEADING)
																						.addGroup(
																								groupLayout
																										.createSequentialGroup()
																										.addGap(1)
																										.addComponent(
																												textField_5,
																												GroupLayout.PREFERRED_SIZE,
																												324,
																												GroupLayout.PREFERRED_SIZE))
																						.addGroup(
																								groupLayout
																										.createSequentialGroup()
																										.addGap(1)
																										.addComponent(
																												textField_3,
																												GroupLayout.PREFERRED_SIZE,
																												324,
																												GroupLayout.PREFERRED_SIZE))
																						.addGroup(
																								groupLayout
																										.createSequentialGroup()
																										.addGap(1)
																										.addComponent(
																												textField_2,
																												GroupLayout.PREFERRED_SIZE,
																												324,
																												GroupLayout.PREFERRED_SIZE))
																						.addGroup(
																								groupLayout
																										.createSequentialGroup()
																										.addGap(1)
																										.addComponent(
																												textField_1,
																												GroupLayout.PREFERRED_SIZE,
																												324,
																												GroupLayout.PREFERRED_SIZE))
																						.addGroup(
																								groupLayout
																										.createSequentialGroup()
																										.addGap(1)
																										.addComponent(
																												textField,
																												GroupLayout.PREFERRED_SIZE,
																												324,
																												GroupLayout.PREFERRED_SIZE))
																						.addComponent(
																								textField_6,
																								GroupLayout.PREFERRED_SIZE,
																								325,
																								GroupLayout.PREFERRED_SIZE)
																						.addGroup(
																								Alignment.TRAILING,
																								groupLayout
																										.createSequentialGroup()
																										.addComponent(
																												btnSalvar)
																										.addGap(8)
																										.addComponent(
																												btnCancelar)))))
										.addContainerGap(20, Short.MAX_VALUE)));
		groupLayout
				.setVerticalGroup(groupLayout
						.createParallelGroup(Alignment.LEADING)
						.addGroup(
								groupLayout
										.createSequentialGroup()
										.addContainerGap()
										.addGroup(
												groupLayout
														.createParallelGroup(
																Alignment.LEADING)
														.addGroup(
																groupLayout
																		.createSequentialGroup()
																		.addComponent(
																				textField_5,
																				GroupLayout.PREFERRED_SIZE,
																				GroupLayout.DEFAULT_SIZE,
																				GroupLayout.PREFERRED_SIZE)
																		.addGap(9)
																		.addComponent(
																				textField_3,
																				GroupLayout.PREFERRED_SIZE,
																				GroupLayout.DEFAULT_SIZE,
																				GroupLayout.PREFERRED_SIZE)
																		.addGap(11)
																		.addComponent(
																				textField_2,
																				GroupLayout.PREFERRED_SIZE,
																				GroupLayout.DEFAULT_SIZE,
																				GroupLayout.PREFERRED_SIZE)
																		.addGap(11)
																		.addComponent(
																				textField_1,
																				GroupLayout.PREFERRED_SIZE,
																				GroupLayout.DEFAULT_SIZE,
																				GroupLayout.PREFERRED_SIZE)
																		.addGap(6)
																		.addComponent(
																				textField,
																				GroupLayout.PREFERRED_SIZE,
																				GroupLayout.DEFAULT_SIZE,
																				GroupLayout.PREFERRED_SIZE)
																		.addGap(18)
																		.addComponent(
																				textField_6,
																				GroupLayout.PREFERRED_SIZE,
																				GroupLayout.DEFAULT_SIZE,
																				GroupLayout.PREFERRED_SIZE))
														.addGroup(
																groupLayout
																		.createSequentialGroup()
																		.addComponent(
																				label)
																		.addGap(15)
																		.addComponent(
																				label_1)
																		.addGap(17)
																		.addComponent(
																				label_2)
																		.addGap(17)
																		.addComponent(
																				label_3)
																		.addGap(12)
																		.addComponent(
																				label_4)
																		.addGap(24)
																		.addComponent(
																				label_5)))
										.addPreferredGap(
												ComponentPlacement.RELATED)
										.addGroup(
												groupLayout
														.createParallelGroup(
																Alignment.BASELINE)
														.addComponent(btnSalvar)
														.addComponent(
																btnCancelar))
										.addGap(8)));
		getContentPane().setLayout(groupLayout);
	}
}
